<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>旋转立方体</title>
    <style>
        html,
        body {
            margin: 0;
            padding: 0;
        }

        .one {
            width: 500px;
            height: 500px;
            margin: 150px;
            position: relative;
            border: 1px solid red;
        }

        .two {
            transform-style: preserve-3d;
            margin-top: 150px;
            margin-left: 150px;
            width: 200px;
            height: 200px;
            border: 1px solid red;
            animation: two 5s ease 2s infinite alternate ;
        }
        .two img{
            position: absolute;
            width: 200px;
            height: 200px;
            opacity: 0.8;
            transition: all 4s;
        }
        .two .row-1{
            transform: rotateY(0deg) translateZ(100px);
        }
        .two .row-2{
            transform: translateZ(-100px) rotateY(180deg);
        }
        .two .row-3{
            transform: rotateY(-90deg) translateZ(100px);
        }
        .two .row-4{
            transform: rotateY(90deg) translateZ(100px);
        }
        .two .row-5{
            transform: rotateX(-90deg) translateZ(100px);
        }
        .two .row-6{
            transform: rotateX(90deg) translateZ(100px);
        }
        @keyframes two { 
            from {
                transform: rotateX(0deg) rotateY(0deg);
            }
            to {
                transform: rotateX(360deg) rotateY(360deg);
            }
        }
        .two:hover .row-1{
            transform: rotateY(0deg) translateZ(200px);
        }
        .two:hover .row-2{
            transform: rotateY(180deg) translateZ(200px);
        }
        .two:hover .row-3{
            transform: rotateY(-90deg) translateZ(200px);
        }
        .two:hover .row-4{
            transform: rotateY(90deg) translateZ(200px);
        }
        .two:hover .row-5{
            transform: rotateX(-90deg) translateZ(200px);
        }
        .two:hover .row-6{
            transform: rotateX(90deg) translateZ(200px);
        }
        .three {
            transform-style: preserve-3d;
            margin-top: -150px;
            margin-left: 200px;
            width: 100px;
            height: 100px;
            border: 1px solid red;
            animation: two 5s ease 2s infinite alternate ;
        }
        .three img{
            position: absolute;
            width: 100px;
            height: 100px;
            opacity: 0.8;
            transition: all 4s;
        }
        .three .col-1{
            transform: rotateY(0deg) translateZ(100px);
        }
        .three .col-2{
            transform: translateZ(-100px) rotateY(180deg);
        }
        .three .col-3{
            transform: rotateY(-90deg) translateZ(100px);
        }
        .three .col-4{
            transform: rotateY(90deg) translateZ(100px);
        }
        .three .col-5{
            transform: rotateX(-90deg) translateZ(100px);
        }
        .three .col-6{
            transform: rotateX(90deg) translateZ(100px);
        }
    </style>
</head>

<body>
    <div class="one">
        <div class="two">
            <img src="./img/1 (1).jpeg" alt="" class="row-1">
            <img src="./img/1 (2).jpeg" alt="" class="row-2">
            <img src="./img/1 (3).jpeg" alt="" class="row-3">
            <img src="./img/1 (4).jpeg" alt="" class="row-4">
            <img src="./img/1 (5).jpeg" alt="" class="row-5">
            <img src="./img/1 (6).jpeg" alt="" class="row-6">
        </div>
        <div class="three">
            <img src="./img/1 (11).jpeg" alt="" class="col-1">
            <img src="./img/1 (7).jpeg" alt=""  class="col-2">
            <img src="./img/1 (8).jpeg" alt=""  class="col-3">
            <img src="./img/1 (9).jpeg" alt=""  class="col-4">
            <img src="./img/1 (10).jpeg" alt="" class="col-5">
            <img src="./img/1 (12).jpeg" alt="" class="col-6">
        </div>
    </div>
</body>

</html>